<?php

	/**
	 * File : mysql_requests.php
	 * Description : Requête SQL dédiées
	 * Date : 07.08.2012 14:55:30
	 * 
	 * This file is part of Phenix.  Phenix is free software: you can
	 * redistribute it and/or modify it under the terms of the GNU General Public
	 * License as published by the Free Software Foundation, version 2.
	 *
	 * This program is distributed in the hope that it will be useful, but WITHOUT
	 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
	 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
	 * details.
	 *
	 * You should have received a copy of the GNU General Public License along with
	 * this program; if not, write to the Free Software Foundation, Inc., 51
	 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
	 *
	 * Copyright Nils Schaetti <n.schaetti@gmail.com>
	**/

	/*
	 * Requête de login
	 */
	function loginRequest($username)
	{
		return "SELECT * FROM phenix_logins WHERE username='$username'";
	}

	/**
	 * Requête de session
	 */
	function createSessionRequest($uid)
	{
		return "INSERT INTO phenix_sessions VALUES ('',$uid,NOW(),NOW())";
	}

	/**
	 * Requête pour récupérer l'uid d'un utilisateur
	 */
	function getUserRequest($username)
	{
		return "SELECT * FROM phenix_logins WHERE username='$username'";
	}

?>
